import { Router } from 'express'
import { 
  getPlayerList, 
  getPlayerDetail, 
  createPlayerHandler, 
  updatePlayerHandler, 
  deletePlayerHandler,
  getAllPlayersForGrouping
} from '../controllers/playerController'

const router: Router = Router()

// 获取选手列表（分页）
router.get('/', getPlayerList)

// 获取所有选手（不分页，用于分组页面）
router.get('/all', getAllPlayersForGrouping)

// 获取选手详情
router.get('/:id', getPlayerDetail)

// 创建选手
router.post('/', createPlayerHandler)

// 更新选手
router.put('/:id', updatePlayerHandler)

// 删除选手
router.delete('/:id', deletePlayerHandler)

export default router
